const request = require('../../utils/request.js');
Page({
  data: {
    records: [
      {
        time: "2024-10-01 12:59:59",
        deviceName: "大门",
        inOutType: "进"
      },
      {
        time: "2024-10-01 12:59:59",
        deviceName: "大门",
        inOutType: "进"
      },
      {
        time: "2024-10-01 12:59:59",
        deviceName: "大门",
        inOutType: "进"
      },
      // 可继续添加更多模拟数据，或者后续从接口获取
      {
        time: "2024-10-01 13:00:00",
        deviceName: "南门",
        inOutType: "出"
      },
      {
        time: "202-10-01 13:05:00",
        deviceName: "君合大门",
        inOutType: "进"
      }
    ]
  },
  onBack(){
    wx.navigateTo({
      url: '/pages/visitedetail_lxy/visitedetail',
    })
  },

  onLoad: function (options) {
    // 实际项目中，可在此处通过 wx.request 从后端接口获取真实的 records 数据
    // 示例：
    // wx.request({
    //   url: '你的接口地址',
    //   success: (res) => {
    //     if (res.data.code === 0) {
    //       this.setData({
    //         records: res.data.data
    //       });
    //     }
    //   }
    // });
  }
});